package com.kkb.controller;

import com.kkb.pojo.Team;
import com.kkb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@RequestMapping("param")
@Controller
public class TeamController {
    //@Autowired
    //private UserService userService;

    @RequestMapping(value = "test03/{id}/{name}")
    public ModelAndView test3(@PathVariable("id") Integer tId,
                              @PathVariable("name") String tName){
        //userService.add();// 使用spring容器创建一个对象
        System.out.println("球队id是"+tId+",球队名字是："+tName);
        return new ModelAndView("param/success");
    }

    @RequestMapping(value = "test02")
    public ModelAndView test1(Team team){

        System.out.println("球队id是"+team.gettId()+",球队名字是："+team.gettName());
        return new ModelAndView("param/success");
    }


    @RequestMapping(value = "test01")
    public ModelAndView test( Integer tId, String tName){

        //userService.add();// 使用spring容器创建一个对象
        System.out.println("球队id是"+tId+",球队名字是："+tName);
        return new ModelAndView("param/success");
    }

    @RequestMapping(value = "team")
    public ModelAndView team(){
        return new ModelAndView("param/team");
    }



}
